package com.mail.dubbo.mapper;

import com.mail.model.db.UmsAdminLoginLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

/**
 * <p>
 * 后台用户登录日志表 Mapper 接口
 * </p>
 *
 * @author WJZ
 * @since 2022-06-20
 */
public interface UmsAdminLoginLogMapper extends BaseMapper<UmsAdminLoginLog> {

	/**
	 * 根据 id 查询登录日志, 获取最后登录时间
	 * @param id
	 * @return
	 */
	@Select("select create_time from ums_admin_login_log where admin_id = #{id} order by create_time desc limit 1 ;")
	LocalDateTime getLastLoginTime(Long id);
}
